package cn.sc.summer.daoapi.po;

import com.baomidou.mybatisplus.annotation.TableName;
import cn.sc.summer.constant.seneitive.Sensitive;
import cn.sc.summer.constant.seneitive.SensitiveTypeEnum;
import cn.sc.summer.mybatis.annotation.encrypt.EncryptedField;
import cn.sc.summer.mybatis.annotation.encrypt.EncryptedTable;
import cn.sc.summer.mybatis.annotation.table.TableFieldX;
import cn.sc.summer.mybatis.annotation.table.TableX;
import cn.sc.summer.mybatis.model.BaseTenantModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * 类名：路由信息
 *
 * @author a-xin
 * @date 2023/9/8 13:07
 */
@Data
@Accessors(chain = true)
@TableName(value = "test_tree")
@EqualsAndHashCode(callSuper = true)
@EncryptedTable
@TableX(dataSource = {"postgresql", "slave"}, comment = "我是测试的备注信息")
public class TestTree extends BaseTenantModel implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 父级ID
     */
    @TableFieldX(comment = "父级ID", primary = true)
    private String pId;

    /**
     * 左值
     */
    @TableFieldX(nullable = true, comment = "左值")
    private Integer lft;

    /**
     * 右值
     */
    @TableFieldX(nullable = true, comment = "右值")
    private Integer rgt;

    /**
     * 编码
     */
    @EncryptedField
    @Sensitive(type = SensitiveTypeEnum.PHONE_NUM)
    private String code;

}
